package com.eni.dvtejb.web;

import java.io.IOException;
import java.io.PrintWriter;

import javax.ejb.EJB;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.jboss.xnio.log.Logger;

import com.eni.dvtejb.metier.sessions.FacadeRemote;

/**
 * Servlet implementation class TestStateless
 */
public class TestStateless extends HttpServlet {
	private static final long serialVersionUID = 1L;
	private static final Logger log=Logger.getLogger(TestStateless.class);
	@EJB(name="VenteEnLigne/FacadeBean/remote")
	private FacadeRemote facadeBean;
	
       
    /**
     * @see HttpServlet#HttpServlet()
     */
    public TestStateless() {
        super();
        // TODO Auto-generated constructor stub
    }

	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		boolean res;
		response.setContentType("text/html");
		PrintWriter out=response.getWriter();
		out.println("<center>");
		res=facadeBean.findByLoginPwd("triomphe", "LACOSTE");
		out.println("RESULTAT " + res);
		
	}

	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
	}

}
